<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>增加页面</title>
<%
	String bathPath = request.getContextPath();
	pageContext.setAttribute("bathPath", bathPath);
%>

  <link rel="stylesheet" href="${bathPath}/frame/layui/css/layui.css"  media="all">
  <script type="text/javascript" src="${bathPath}/js/jquery-1.9.1.min.js" ></script>
<script type="text/javascript" src="${bathPath}/js/ajaxSessionOut.js" ></script>
<!-- layer -->
<link type="text/css" rel="stylesheet" href="${bathPath}/js/layer/skin/layer.css"/>
<script type="text/javascript" src="${bathPath}/js/layer/layer.js" ></script>
<script src="${bathPath}/frame/layui/layui.js" charset="utf-8"></script>

<!-- layer -->
<link type="text/css" rel="stylesheet" href="${bathPath}/js/layer/skin/layer.css"/>
<link type="text/css" rel="stylesheet" href="${bathPath}/js/layer/layer.js"/>
<script type="text/javascript">
layui.use(['form', 'layedit', 'laydate','upload'], function(){
    var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,upload = layui.upload;

    //日期
    laydate.render({
        elem: '#birthday'
    });
    laydate.render({
        elem: '#birthday'
    });
    laydate.render({
        elem: '#eddate'
    });
    laydate.render({
        elem: '#eddate'
    });
    laydate.render({
        elem: '#cardvaliddate'
    });
    laydate.render({
        elem: '#cardvaliddate'
    });
});
	
function search(){
	var param=$("form").serialize();
	$.ajax({
		type:"POST",
		async:false,
		dataType:"text",
		data:param,
		url:"${bathPath}/aDKManageUser/insert.action",
		success:function(data){
			layer.confirm("保存成功！", {btn: ['确定'], title: "提示",skin:"my-skin"}, function(){
				parent.layer.close(parent.layer.index);
				parent.location.reload();
				});
			}
		});
	}
	
$(function(){
	$.ajax({
		 type:"POST",
		 async:false,
		 data:"",
	     url:"${bathPath}/aDKUserInfo/selectDpetName.action",
	     success:function(msg){
	    	var html="";
	    	html+="<option value=''>"+'请选择'+"</option>";
	    	for (var i = 0; i < msg.length; i++) {
			    html+="<option value='"+msg[i].depId+"'>"+msg[i].depName+"</option>";
			}
	    	$("#depId").html(html);
	     }
	 });
	
	//所属组织机构下拉框回填
	$("#depId").val("${u.depId}");
});
layui.use('form', function(){
	  var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
	  //alert("${zuzhi.netgroupid}");
	  if("${u.gender}"==0){
	     $("input[type=radio][name=gender][value=0]").attr("checked",'checked');
   }else{
	     $("input[type=radio][name=gender][value=1]").attr("checked",'checked');
   }
	  //……
	  //但是，如果你的HTML是动态生成的，自动渲染就会失效
	  //因此你需要在相应的地方，执行下述方法来手动渲染，跟这类似的还有 element.init();
	  form.render();
});

</script>
<style type="text/css">
	img {
		margin-left: 10px;
		width: 20px;
		height: 20px;
	}
	
	
	}
</style></head>
<body >
	
	<div id="tt" class="easyui-panel" style="width:435px;height:455px;">
	
<div class="first_div" style="border-right:none;border-bottom:none;border-left:none;">

	<form class="layui-form layui-form-pane" action="" method="post" enctype="multipart/form-data">
	<input type="hidden" name="id" value="${u.id}" />
	<div class="layui-inline">
	     <div class="layui-form-item" style="margin-left:15px; margin-top: 15px;">
	     <div class="layui-inline">
	    	<label class="layui-form-label"  style="width: 160px;">账号</label>
		   	<div class="layui-input-block" style="width: 150px;margin-left:160px;" >
		   		<input type="text" id="userName" name="userName" lay-verify="required" style="width:230px;" placeholder="请输入" class="layui-input"  value="${u.userName}" />
		    </div>
		 </div>
  	</div>
  
  
    <div class="layui-form-item" style="margin-left: 15px;margin-top: -12px;">
    <div class="layui-inline">
        <label class="layui-form-label" style="width: 160px;">密码</label>
        <div class="layui-input-inline">
    <input type="password" id="password" name="password" lay-verify="required" style="width:230px;" placeholder="请输入" class="layui-input"  value="${u.password}" />
      </select>
        </div>
    </div>
    </div>
   
   <div class="layui-form-item" style="margin-left: 15px;margin-top: -12px;">
     <div class="layui-inline">
        <label class="layui-form-label" style="width: 160px;">姓名</label>
        <div class="layui-input-inline">
           <input type="text" id="realName" name="realName" lay-verify="required" style="width:230px;" placeholder="请输入" class="layui-input"  value="${u.realName}" />
        </div>
    </div>
    </div>
    
    
    <div class="layui-form-item" style="margin-left: 15px;margin-top: -12px;">
     <div class="layui-inline">
        <label class="layui-form-label" style="width: 160px;">所属部门</label>
        <div class="layui-input-inline" style="width:230px;">
             <select type="text" id="depId" name="depId" lay-verify="required"  autocomplete="off" class="layui-input">
        </select>
        </div>
    </div>
    </div>
    
    
     <div class="layui-form-item" style="margin-left: 15px;margin-top: -12px;">
     <div class="layui-inline">
        <label class="layui-form-label" style="width: 160px;">职位</label>
        <div class="layui-input-inline">
            <input type="text" id="position" name="position" lay-verify="required" style="width:230px;" placeholder="请输入" class="layui-input"  value="${u.position}" />
        </div>
    </div>
    </div>
    </div>
    
    <div class="layui-form-item" style="margin-left: 15px;margin-top: -12px;">
     <div class="layui-inline">
        <label class="layui-form-label" style="width: 160px;">移动电话</label>
        <div class="layui-input-inline">
            <input type="text" id="phone" name="phone" lay-verify="required" style="width:230px;" placeholder="请输入" class="layui-input"  value="${u.phone}" />
        </div>
    </div>
    </div>
    
    <div class="layui-form-item" style="margin-left: 15px;margin-top: -12px;">
     <div class="layui-inline">
       <label class="layui-form-label"  style="width: 160px;">性别</label>
	   <div class="layui-input-block" style="width: 200px;margin-left:160px;" >
	      <input type="radio" id="shikeyword" name="gender" value="0" title="男" lay-filter="jiedian" />
          <input type="radio" id="foukeyword" name="gender" value="1" title="女" checked ="" lay-filter="jiedian" />
	    </div>
    </div>
    </div>
    
    <div class="layui-form-item" style="margin-left: 15px;margin-top: -12px;">
     <div class="layui-inline">
        <label class="layui-form-label" style="width: 160px;">邮箱</label>
        <div class="layui-input-inline">
           <input type="text" id="email" name="email" lay-verify="required" style="width:230px;" placeholder="请输入" class="layui-input"  value="${u.email}" />
        </div>
    </div>
    </div>
     <div class="layui-form-item" style="margin-top: -12px;">
     <div class="layui-inline " style="margin-left: 15px;">
     <label class="layui-form-label"  style="width: 160px;">地址</label>
	   <div class="layui-input-block" style="width: 230px;margin-left:160px;" >
	      <input type="text" id="address" name="address" lay-verify="required" placeholder="请输入" 
                   class="layui-input"  value="${u.address}" />
	    </div>
	    </div>
	    </div>
	    
	    <div class="layui-form-item" style="margin-top: -12px;">
     <label class="layui-form-label" style="width:390px;margin-left:15px;">备注：</label>
	   <div class="layui-input-block" style="width: 390px;margin-left:15px;" >
	      <textarea id="memo" name="memo" placeholder="请输入内容" class="layui-textarea" > ${zuzhi.memo}</textarea>
	    </div>
	    </div>
</form>
	 <div class="layui-form-item">
        <button class="layui-btn" lay-submit="" id="bao"  lay-filter="sub" style="margin-left:170px;" onclick="search()">保存</button>
    </div>
	<div style="margin:3px 10px 10px 10px;"></div>
	
	<table id="dg"></table>
	</div>
	</div>
</body>
</html>